// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   NodeSystemServiceImpl.java

package com.hfstu.ifs.dataaccess.service.impl;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.hfstu.framework.core.orm.Page;
import com.hfstu.framework.core.orm.PageRequest;
import com.hfstu.ifs.dataaccess.dao.IMenuDao;
import com.hfstu.ifs.dataaccess.dao.INodeSystemDao;
import com.hfstu.ifs.dataaccess.service.INodeSystemService;
import com.hfstu.ifs.dto.MenuDTO;
import com.hfstu.ifs.dto.NodeSystemDTO;
import com.hfstu.ifs.model.Menu;
import com.hfstu.ifs.model.NodeSystem;
import java.io.Serializable;
import java.util.*;

public class NodeSystemServiceImpl
	implements INodeSystemService
{

	private INodeSystemDao nodeSystemDao;
	private IMenuDao menuDao;

	public NodeSystemServiceImpl()
	{
		nodeSystemDao = null;
		menuDao = null;
	}

	public void delete(NodeSystem entity)
	{
		nodeSystemDao.delete(entity);
	}

	public NodeSystem save(NodeSystem entity)
	{
		return (NodeSystem)nodeSystemDao.save(entity);
	}

	public NodeSystem update(NodeSystem entity)
	{
		return (NodeSystem)nodeSystemDao.update(entity);
	}

	public NodeSystem saveOrUpdate(NodeSystem entity)
	{
		return (NodeSystem)nodeSystemDao.saveOrUpdate(entity);
	}

	public void delete(String id)
	{
		nodeSystemDao.delete(id);
	}

	public NodeSystem getById(String id)
	{
		return (NodeSystem)nodeSystemDao.getById(id);
	}

	public List getByIds(String ids[])
	{
		return nodeSystemDao.getByIds(ids);
	}

	public List findAll()
	{
		return nodeSystemDao.findAll();
	}

	public List findListByCondition(Map filterPropertyMap, Map sortValueMap)
	{
		return nodeSystemDao.findListByCondition(filterPropertyMap, sortValueMap);
	}

	public Page findPageByCondition(PageRequest pageRequest, Map filterPropertyMap, Map sortValueMap)
	{
		return nodeSystemDao.findPageByCondition(pageRequest, filterPropertyMap, sortValueMap);
	}

	public NodeSystemDTO getNodeSystemMenuByNodeSystemCode(String nodeSystemCode)
	{
		List results = null;
		NodeSystemDTO nodeSystemDTO = new NodeSystemDTO();
		nodeSystemDTO.transfer(nodeSystemDao.getByCode(nodeSystemCode));
		Map queryMap = Maps.newHashMap();
		queryMap.put("sd.code", nodeSystemCode);
		Map sortMap = Maps.newHashMap();
		sortMap.put("menu.orderIndex", "ASC");
		List menuLists = menuDao.findListByCondition(queryMap, sortMap);
		List menuDTOLists = Lists.newArrayList();
		if (menuLists != null && menuLists.size() != 0)
		{
			MenuDTO menuDTO;
			for (Iterator iterator = menuLists.iterator(); iterator.hasNext(); menuDTOLists.add(menuDTO))
			{
				Menu menu = (Menu)iterator.next();
				menuDTO = new MenuDTO();
				menuDTO.transfer(menu);
			}

		}
		nodeSystemDTO.reloadTree(menuDTOLists);
		return nodeSystemDTO;
	}

	public INodeSystemDao getNodeSystemDao()
	{
		return nodeSystemDao;
	}

	public void setNodeSystemDao(INodeSystemDao nodeSystemDao)
	{
		this.nodeSystemDao = nodeSystemDao;
	}

	public IMenuDao getMenuDao()
	{
		return menuDao;
	}

	public void setMenuDao(IMenuDao menuDao)
	{
		this.menuDao = menuDao;
	}

	public volatile Object getById(Serializable serializable)
	{
		return getById((String)serializable);
	}

	public volatile Object save(Object obj)
	{
		return save((NodeSystem)obj);
	}

	public volatile Object saveOrUpdate(Object obj)
	{
		return saveOrUpdate((NodeSystem)obj);
	}

	public volatile void delete(Serializable serializable)
	{
		delete((String)serializable);
	}

	public volatile void delete(Object obj)
	{
		delete((NodeSystem)obj);
	}

	public volatile List getByIds(Serializable aserializable[])
	{
		return getByIds((String[])aserializable);
	}

	public volatile Object update(Object obj)
	{
		return update((NodeSystem)obj);
	}
}
